import java.util.Scanner;

public class HJ31 {
    public static void main(String[] srgs){
        Scanner scanner = new Scanner(System.in);
        String str= scanner.nextLine();
        str= str.replaceAll("[^a-zA-Z]"," ");
        String[] strings = str.trim().split("\\s+");
        for(int i=strings.length-1;i >=0 ; i-- ){
            System.out.print(strings[i]);
            if(i !=0){
                System.out.print(" ");
            }
        }
    }
}
